﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="company_edit.aspx.cs" Inherits="DTcms.Web.admin.company.company_edit" ValidateRequest="false" EnableEventValidation="false" Debug="false" %>

<%@ Import Namespace="DTcms.Common" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>编辑企业黄页</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" type="text/css" href="../../scripts/artdialog/ui-dialog.css" />
    <link rel="stylesheet" type="text/css" href="../skin/icon/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/webuploader/webuploader.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../editor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../editor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="../../editor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/uploader.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript">
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();

            var issort = '<%=is_sort%>';
        
            if (issort == "False") {
                $("#txtsort_id").attr("disabled", "disabled");
                $("#txtsort_id").addClass("disabled");
            }
            else { $("#txtsort_id").removeAttr("disabled"); $("#txtsort_id").removeClass("disabled"); }
            //初始化上传控件
            $(".upload-img").InitUploader({ sendurl: "../../tools/upload_ajax.ashx", swf: "../../scripts/webuploader/uploader.swf" });

            $(".upload-video").InitUploader({
                sendurl: "../../tools/upload_ajax.ashx",
                swf: "../../scripts/webuploader/uploader.swf",
                filetypes: 'mp4,flv',
                filesize:'51200'

            });
            //初始化编辑器
            var ue = UE.getEditor('txtContent', {
                serverUrl: '../../../tools/upload_ajax.ashx',
                toolbars: [[
                    'fullscreen', 'source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'removeformat', 'pasteplain', '|', 'forecolor', 'fontsize', 'insertorderedlist', 'insertunorderedlist', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
                    'link', 'unlink', '|',
                    'simpleupload', 'insertimage', 'scrawl', 'insertvideo', 'attachment'
                ]]
            });
            $("#ddlProvince").change(function () {
                $.post('/tools/get_city.ashx?action=get_citys', { province_id: $(this).val() }, function (data) { $("#ddlCity").empty().append(data) }, 'html');
            });
            $("#ddlCity").change(function () {
                $.post('/tools/get_city.ashx?action=get_area', { city_id: $(this).val() }, function (data) { $("#ddlArea").empty().html(data) }, 'html');
            });

        });
    </script>
    <style type="text/css">
        #container {
            min-width: 600px;
            min-height: 550px;
        }

        .inpt {
            border: solid 1px #eee;
            line-height: 20px;
            padding: 3px 0;
            text-indent: 5px;
            width: 170px;
        }

        .sbtn {
            border: solid 1px #eee;
            line-height: 20px;
            padding: 3px 10px;
        }
        input.disabled{
border:1px solid #DDD;
background-color:#F5F5F5;
color:#ACA899;
}
    </style>
     <script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&key=X27BZ-5W43W-QXVRG-R6XHL-QVLQO-IHFA5"></script>
    <script>
		var geocoder,map,marker = null;
        function init() {
             map = new qq.maps.Map(document.getElementById("container"), {
                center: new qq.maps.LatLng(35.759189553287015, 119.21419143676758),
                zoom: 13
            });
            //添加监听事件   获取鼠标单击事件
            qq.maps.event.addListener(map, 'click', function (event) {
                 marker = new qq.maps.Marker({
                    position: event.latLng,
                    map: map
                });
                qq.maps.event.addListener(map, 'click', function (event) {
                    marker.setMap(null);
                });
                $("#txtZuobiao").val(event.latLng);
            });
            //调用地址解析类
            //geocoder = new qq.maps.Geocoder({
            //    complete: function (result) {
            //        map.setCenter(result.detail.location);
            //    }
            //});
			//调用地址解析类
			geocoder = new qq.maps.Geocoder({
				complete : function(result){
				   console.log("result", result);
					map.setCenter(result.detail.location);
					var marker = new qq.maps.Marker({
						map:map,
						position: result.detail.location
					});
				}
			});
        }
        function codeAddress() {
            var address = document.getElementById("address").value;
			console.log("address", address);
            //通过getLocation();方法获取位置信息值
            geocoder.getLocation(address);
        }
        //修改关联客户
        function EditUser() {
            var d = top.dialog({
                title: '修改关联会员',
                url: 'dialog/dialog_user.aspx',
                width: 750,
                height: 450,
                data: window //传入当前窗口
            }).showModal();
            d.lb_username = $("#lbUserName");
            d.userid = $("#txtUserID");
            d.lianxiren = $("#txtLianxiren");
            d.mobile = $("#txtMobile");
        }
        //修改关联圈子
        function EditQuanzi() {
            var d = top.dialog({
                title: '修改关联石材圈',
                url: '/admin/dialog/dialog_quanzi.aspx',
                width: 750,
                height: 450,
                data: window //传入当前窗口
            }).showModal();
            d.lb_quanziname = $("#lbQuanziName");
            d.quanziid = $("#txtQuanziID");
        }
    </script>
</head>

<body class="mainbody" onload="init()">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="site_list.aspx" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
            <a href="../center.aspx"><i class="iconfont icon-home"></i><span>首页</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <a href="site_list.aspx"><span>企业黄页管理</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <span>编辑企业黄页</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--内容-->
        <div id="floatHead" class="content-tab-wrap">
            <div class="content-tab">
                <div class="content-tab-ul-wrap">
                    <ul>
                        <li><a class="selected" href="javascript:;">站点设置</a></li>
                        <li><a href="javascript:;">设置认证企业</a></li>
                        <li><a href="javascript:;">公司简介</a></li>
                        <li><a href="javascript:;">地图导航</a></li>
                        <li><a href="javascript:;">广告图片</a></li>
                        <%--<li><a href="company_albumns_list.aspx?company_id=<%=company_id %>">广告图片</a></li>--%>
                        <li><a href="javascript:;">广告视频</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <dl>
                <dt>开通状态</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="1" Selected="True">开通</asp:ListItem>
                            <asp:ListItem Value="2">关闭</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>企业名称</dt>
                <dd>
                    <asp:TextBox ID="txtTitle" runat="server" CssClass="input normal" datatype="*2-100" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*标题备注，允许中文。</span>
                </dd>
            </dl>
            <dl>
                <dt>生成目录名</dt>
                <dd>
                    <asp:TextBox ID="txtCallIndex" runat="server" CssClass="input normal" datatype="/^[a-zA-Z0-9\-\_]{2,50}$/" errormsg="请填写正确的名称！" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*企业目录，只允许使用英文、下划线。</span>
                </dd>
            </dl>
            <dl>
                <dt>所属类别</dt>
                <dd>
                    <div class="rule-single-select" style="z-index: 200">
                        <asp:DropDownList ID="ddlCategoryId" runat="server" datatype="*" sucmsg=" "></asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>主营产品</dt>
                <dd>
                    <asp:TextBox ID="txtProduct" runat="server" CssClass="input" TextMode="MultiLine" datatype="*0-255" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">255个字符以内</span>
                </dd>
            </dl>
            <dl>
                <dt>经营范围</dt>
                <dd>
                    <asp:TextBox ID="txtbusinessScope" runat="server" CssClass="input" TextMode="MultiLine" datatype="*0-255" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">255个字符以内</span>
                </dd>
            </dl>
            <dl>
                <dt>排序</dt>
                <dd>
                    <asp:TextBox ID="txtsort_id" runat="server" CssClass="input normal" datatype="n1-10" text="0" />
                    <span class="Validform_checktip">排序，数字越大越靠前</span>
                </dd>
            </dl>
            <dl>
                <dt>网站LOGO</dt>
                <dd>
                    <asp:TextBox ID="txtLogo" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                </dd>
            </dl>
            <dl>
                <dt>联系人</dt>
                <dd>
                    <asp:TextBox ID="txtLianxiren" runat="server" CssClass="input normal" />
                </dd>
            </dl>
            <dl>
                <dt>联系电话</dt>
                <dd>
                    <asp:TextBox ID="txtTel" runat="server" CssClass="input normal" />
                    <span class="Validform_checktip">*非必填，区号+电话号码</span>
                </dd>
            </dl>
            <dl>
                <dt>手机号</dt>
                <dd>
                    <asp:TextBox ID="txtMobile" runat="server" CssClass="input normal" datatype="n" sucmsg=" " ajaxurl="../../tools/admin_ajax.ashx?action=companynouser_mobile_check" />
                    <span class="Validform_checktip"></span>
                </dd>
            </dl>
            <dl>
                <dt>企业网址</dt>
                <dd>
                    <asp:TextBox ID="txtwebsite" runat="server" CssClass="input normal" />
                    <span class="Validform_checktip"></span>
                </dd>
            </dl>
            <dl>
                <dt>所在地区</dt>
                <dd>
                    <asp:DropDownList ID="ddlProvince" runat="server"></asp:DropDownList>
                    <asp:DropDownList ID="ddlCity" runat="server">
                        <asp:ListItem Value="0">选择城市</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlArea" runat="server">
                        <asp:ListItem Value="0">选择地区</asp:ListItem>
                    </asp:DropDownList>
                </dd>
            </dl>
            <dl>
                <dt>关联石材圈</dt>
                <dd>
                    <asp:Label ID="lbQuanziName" runat="server" Text=""></asp:Label>
                    <asp:TextBox ID="txtQuanziID" runat="server" Text="0" Style="display: none"></asp:TextBox>
                    <a class="icon-btn" onclick="EditQuanzi()"><i class="iconfont icon-edit"></i><span>设置关联石材圈</span></a>
                </dd>
            </dl>
            <dl>
                <dt>关联会员</dt>
                <dd>
                    <asp:Label ID="lbUserName" runat="server" Text=""></asp:Label>
                    <asp:TextBox ID="txtUserID" runat="server" Text="0" Style="display: none"></asp:TextBox>
                    <a class="icon-btn" onclick="EditUser()"><i class="iconfont icon-edit"></i><span>设置关联会员</span></a>
                </dd>
            </dl>
            <dl>
                <dt>通讯地址</dt>
                <dd>
                    <asp:TextBox ID="txtAddress" runat="server" CssClass="input normal" />
                </dd>
            </dl>
        </div>
        <div class="tab-content" style="display: none">
            <dl>
                <dt>设置认证企业</dt>
                <dd>
                    <div class="rule-single-select" style="z-index: 200">
                        <asp:DropDownList ID="ddlRzCategoryID" runat="server" datatype="*" sucmsg=" "></asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>认证封面图</dt>
                <dd>
                    <asp:TextBox ID="txtRzImgUrl" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                    图片尺寸：700x350像素
                </dd>
            </dl>
        </div>
        <div class="tab-content" style="display: none">
            <textarea id="txtContent" class="editor" runat="server" style="width: 100%; height: 280px;"></textarea>
        </div>

        <div class="tab-content" style="display: none">
            <dl>
                当前坐标：<asp:TextBox ID="txtZuobiao" runat="server" CssClass="input normal"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
                搜索地理位置：<input id="address" type="text" class="inpt" /><input type="button" value="搜索" class="sbtn" onclick="codeAddress()" />
            </dl>
            <dl>
                <div id="container"></div>
            </dl>
        </div>
        <div class="tab-content" style="display: none">
            <dl>
                <dt>广告图片</dt>
                <dd>
                    <asp:TextBox ID="txtTopImg" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                    图片尺寸:640x300像素
                </dd>
            </dl>
        </div>
        <div class="tab-content" style="display: none">
            <dl>
                <dt>视频图片</dt>
                <dd>
                    
                    <asp:TextBox ID="txtvideo_img" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box  upload-img"></div>

                    <br />
                   
                </dd>
            </dl>
            <dl>
                <dt>广告视频</dt>
                <dd>
                    
                    <asp:TextBox ID="txtvideo" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box  upload-video"></div>

                    <br />
                    <a href="<%=video_url %>" target="_blank"><%=video_url %></a>
                </dd>
            </dl>
        </div>
        <!--/内容-->

        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-wrap">
                <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
            </div>
        </div>
        <!--/工具栏-->

    </form>
</body>
</html>

